package org.apache.qpid.management.common.sasl;

import java.security.Provider;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.harmony.javax.security.sasl.SaslClientFactory;

public class JCAProvider extends Provider
{
  private static final long serialVersionUID = 1L;

  public JCAProvider(Map<String, Class<? extends SaslClientFactory>> paramMap)
  {
    super("AMQSASLProvider", 1D, "A JCA provider that registers all AMQ SASL providers that want to be registered");
    register(paramMap);
  }

  private void register(Map<String, Class<? extends SaslClientFactory>> paramMap)
  {
    Iterator localIterator = paramMap.entrySet().iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return;
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      put("SaslClientFactory." + ((String)localEntry.getKey()), ((Class)localEntry.getValue()).getName());
    }
  }
}